import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpExchangeLog {
  id!: number;
  did!: number;
  type!: number;
  code!: string;
  cid?: number;
  termType?: boolean;
  termDay?: number;
  dataJson?: unknown;
  time?: string;
  uniacid!: number;
  userId!: number;
}

export const ImsYzdKpExchangeLogSchema = new EntitySchema({
  class: ImsYzdKpExchangeLog,
  properties: {
    id: { primary: true, type: 'number' },
    did: { type: 'number' },
    type: { type: 'number' },
    code: { type: 'string', length: 255 },
    cid: { type: 'number', nullable: true },
    termType: { type: 'boolean', nullable: true },
    termDay: { type: 'number', nullable: true },
    dataJson: { type: 'unknown', columnType: 'longtext', nullable: true },
    time: { type: 'string', length: 255, nullable: true },
    uniacid: { type: 'number' },
    userId: { type: 'number' },
  },
});
